#pragma once
#include "alg_type_defs.h"
#include "points.h"
#include "gtest/gtest.h"
#include "rotate.h"


GEO_ALG_USE_NAMESPACE

TEST(PointOperator, points) {
    Point2d  p1(1, 2);
    p1 *= 2;
    Point2d p2(2, 4);
    ASSERT_EQ(p1, p2);
    Point2d p3 = p2;
    p3.normalized();
    EXPECT_DOUBLE_EQ(p3.mod(), 1.0);
}

TEST(PointOperator, points2) {
    Point2d  p1(1, 2);
    Point2d p2(2, 4);
    auto p4 = p1 + p2;
    Point2d p3(3, 6);
    ASSERT_EQ(p3, p4);
}



TEST(RotateTest, rotates) {
    Point2d p1(1, 0);
    Point2d p2(0, 1);
    Point2d p3 = rotate(p1, PI_DIV_2);
    ASSERT_EQ(p3, p2);
}